import nyNetwork from "@/api/nyBaseNetwork";

class DZModelthisInfo {

    /**
     * 调查问卷ID
     */
    id = '';

    /**
     * 调查问卷名称
     */
    name = '';

    /**
     * 列表封面
     */
    listCover = '';

    /**
     * 列表封面路径
     */
    listCoverUrl = '';

    /**
     * 内容封面
     */
    infoCover = '';

    /**
     * 内容封面路径
     */
    infoCoverUrl = '';

    /**
     * 问卷类型：0-不带量表，1-带量表
     */
    type = 0;

    /**
     * 问卷介绍
     */
    info = '';

    /**
     * 问卷描述
     */
    desc = '';

    /**
     * 基本信息模板ID
     */
    baseTemplate = '';

    /**
     * 基本信息模板名称
     */
    baseTemplateName = '';

    /**
     * 问题模板ID
     */
    questionTemplate = '';

    /**
     * 问题模板名称
     */
    questionTemplateName = '';

    /**
     * 量表ID
     */
    assessId = '';

    /**
     * 量表名称
     */
    assessName = '';

    /**
     * 排序
     */
    sort = 0;

    /**
     * 二维码
     */
    erCordUrl = "";


    init() {
        this.id = '';
        this.name = '';
        this.listCover = '';
        this.listCoverUrl = '';
        this.infoCover = '';
        this.infoCoverUrl = '';
        this.type = 0;
        this.info = '';
        this.desc = '';
        this.baseTemplate = '';
        this.baseTemplateName = '';
        this.questionTemplate = '';
        this.questionTemplateName = '';
        this.assessId = '';
        this.assessName = '';
        this.sort = 0;
    }

    parse(data) {
        this.id = data.iId ?? '';
        this.name = data.sName ?? '';
        this.listCover = data.iListCover ?? '';
        if (this.listCover) {
            this.listCoverUrl = nyNetwork.image(this.listCover);
        }
        this.infoCover = data.iInfoCover ?? '';
        if (this.infoCover) {
            this.infoCoverUrl = nyNetwork.image(this.infoCover);
        }
        this.type = data.iType ?? 0;
        this.info = data.sInfo ?? '';
        this.desc = data.sDesc ?? '';
        this.baseTemplate = data.iBaseTemplate ?? '';
        this.baseTemplateName = data.sBaseTemplateName ?? '';
        this.questionTemplate = data.iQuestionTemplate ?? '';
        this.questionTemplateName = data.sQuestionTemplateName ?? '';
        this.assessId = data.iAssessId ?? '';
        this.assessName = data.sAssessName ?? '';
        this.sort = data.iSort ?? 0;
    }
}
export default DZModelthisInfo;